//
//  ZFJPopManager.h
//  GSDemo
//
//  Created by ZhangFujie on 2022/10/12.
//

#import <Foundation/Foundation.h>
#import "ZFJPopManagerHeader.h"

@class ZFJPopModel, ZFJPopView;

@interface ZFJPopManager : NSObject

/// 初始化
+ (instancetype)sharedInstance;

/// 销毁单利
+ (void)destroy;

/// 开始弹框
/// 在topView上弹出，如果为nil就在windows上弹出
- (void)startPopView;
- (void)startPopView:(UIView *)topView;

/// 停止弹框
- (void)stopPopView;

/// 错误码回调，在所以的方法之前调用，保证能回调所有的错误
@property (nonatomic,assign) ZFJPopErrorBlock popErrorCodeBlock;

/// 视图将要出现
@property (nonatomic,  copy) ZFJPopModelBlock viewWillAppear;

/// 视图已经出现
@property (nonatomic,  copy) ZFJPopModelBlock viewDidAppear;

/// 视图将要消失
@property (nonatomic,  copy) ZFJPopModelBlock viewWillDisappear;

/// 视图已经消失
@property (nonatomic,  copy) ZFJPopModelBlock viewDidDisappear;

/// 视图都弹出了
@property (nonatomic,  copy) ZFJPopVoidBlock popFinishedBlock;

/// 倒计时回调
@property (nonatomic,  copy) ZFJPopCountDownBlock popCountDownBlock;

/// 正在弹出的弹出model
@property (nonatomic,strong,readonly) ZFJPopModel *currentPopModel;

/// 正在弹出的弹出popview
@property (nonatomic,strong,readonly) ZFJPopView *currentPopView;

/// 添加一个动画视图
- (void)addPopModel:(ZFJPopModel *)model;

/// 添加多个动画视图
- (void)addPopModelsFromArray:(NSArray<ZFJPopModel *> *)otherArray;

/// 移除一个动画视图
- (void)removePopModel:(ZFJPopModel *)model;

/// 移除所有的动画视图
- (void)removeAllPopModels;

/// keyWindow视图
- (UIWindow *)zfj_keyWindow;

@end
